
import copy

name = 'shuiyihang'

def _val_domain():
    try:
        print(name)     #error
        name = 'shui'   #如果没有这句赋值,name就是全局变量，它的值就是"shuiyihang",
                    #否则，name是局部变量但是在打印之前并没有声明，所以会报错
    except:
        print("occur an error!")

def modify_list(temp):
    temp[0] = "modify"
    print(temp)

str_list = ['Aba','aba','Fcc','blue']
test_list = [['a','b'],'c','d']

if __name__ == '__main__':
    # _val_domain()  #测试1,验证try except,使用取消注释

    str_list.sort(key = str.lower)#验证排序方法
    print(str_list)

    modify_list(copy.deepcopy(test_list))#验证引用和拷贝
    print(test_list)